home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / libfpvm / pvmfaddhost.m4 < prev    next >
Text File  |  1997-07-22  |  530b  |  30 lines

  1.  
  2. /* $Id: pvmfaddhost.m4,v 1.2 1996/10/04 15:26:53 pvmsrc Exp $ */
  3.  
  4. #include "pvm3.h"
  5. #include "pvm_consts.h"
  6.  
  7. void
  8. FUNCTION(pvmfaddhost) ARGS(`STRING_ARG(host), info')
  9. STRING_ARG_DECL(host);
  10. int *info;
  11. {
  12.     int  dtid;
  13.     char thost[MAX_HOST_NAME + 1];
  14.     char *ptr = thost;
  15.  
  16.     /*
  17.      * Copy the host name to make sure there's
  18.      * a NUL at the end.
  19.      */
  20.     if (ftocstr(thost, sizeof(thost), STRING_PTR(host), STRING_LEN(host))) {
  21.         *info = PvmBadParam;
  22.         return;
  23.     }
  24.  
  25.     *info = pvm_addhosts(&ptr, 1, &dtid);
  26.     if (*info >= 0)
  27.         *info = dtid;
  28. }
  29.  
  30.